home *** CD-ROM | disk | FTP | other *** search
- property pSprite, pUndoTrigger
- global gProject, gSize, gCast, gVariable, gFirstColor, gSecondColor, g4bitValues, gPencilSize, gPencilShape, gEraserSize, gEraserShape, gBrushSize, gBrushShape, gAirbrushSize, gAirbrushShape, gGradientDirection, gClonerShape, gClonerSize, gClonerFlag, gClonerHDist, gClonerVDist, myCurrentImage, pPixelActorListX, pPixelActorListY, pSpreadListX, pSpreadListY, currentCursor, gCurrentColor, gShapeType, gRectStyle, gOvalStyle, gRoundRectStyle, gWvBgColor, gWvBgShadow, gWvVcolor, gWvVShadow, gWvHcolor, gWvHShadow, gMarqueeRect
-
- on beginSprite me
- pSprite = sprite(me.spriteNum)
- pUndoTrigger = 0
- end
-
- on mouseWithin me
- if sprite(64).pState = 1 then
- if gPencilSize = 1 then
- nothing()
- else
- sprite(8).rect = rect(the mouseH - (gPencilSize * gVariable / 2), the mouseV - (gPencilSize * gVariable / 2), the mouseH + (gPencilSize * gVariable / 2), the mouseV + (gPencilSize * gVariable / 2))
- end if
- else
- if sprite(73).pState = 1 then
- sprite(8).rect = rect(the mouseH - (gBrushSize * gVariable / 2), the mouseV - (gBrushSize * gVariable / 2), the mouseH + (gBrushSize * gVariable / 2), the mouseV + (gBrushSize * gVariable / 2))
- else
- if sprite(84).pState = 1 then
- if gEraserSize = 1 then
- nothing()
- else
- sprite(8).rect = rect(the mouseH - (gEraserSize * gVariable / 2), the mouseV - (gEraserSize * gVariable / 2), the mouseH + (gEraserSize * gVariable / 2), the mouseV + (gEraserSize * gVariable / 2))
- end if
- else
- if sprite(96).pState = 1 then
- sprite(8).rect = rect(the mouseH - (gAirbrushSize * gVariable / 2), the mouseV - (gAirbrushSize * gVariable / 2), the mouseH + (gAirbrushSize * gVariable / 2), the mouseV + (gAirbrushSize * gVariable / 2))
- else
- if sprite(104).pState = 1 then
- if gClonerSize = 1 then
- if gClonerFlag = 0 then
- nothing()
- else
- sprite(9).loc = point(((the mouseH - sprite(1).left) * 2 / gVariable / 2 * gVariable) + sprite(1).left + (gVariable / 2) + (gClonerHDist * gVariable), ((the mouseV - sprite(1).top) * 2 / gVariable / 2 * gVariable) + sprite(1).top + (gVariable / 2) + (gClonerVDist * gVariable))
- end if
- else
- if gClonerFlag = 0 then
- sprite(8).rect = rect(the mouseH - (gClonerSize * gVariable / 2), the mouseV - (gClonerSize * gVariable / 2), the mouseH + (gClonerSize * gVariable / 2), the mouseV + (gClonerSize * gVariable / 2))
- else
- sprite(8).rect = rect(the mouseH - (gClonerSize * gVariable / 2), the mouseV - (gClonerSize * gVariable / 2), the mouseH + (gClonerSize * gVariable / 2), the mouseV + (gClonerSize * gVariable / 2))
- sprite(9).loc = point(((the mouseH - sprite(1).left) * 2 / gVariable / 2 * gVariable) + sprite(1).left + (gVariable / 2) + (gClonerHDist * gVariable), ((the mouseV - sprite(1).top) * 2 / gVariable / 2 * gVariable) + sprite(1).top + (gVariable / 2) + (gClonerVDist * gVariable))
- end if
- end if
- else
- if sprite(146).pState = 1 then
- if (gMarqueeRect <> rect(0, 0, 0, 0)) and inside(point(the mouseH, the mouseV), gMarqueeRect) then
- pSprite.cursor = [412, 413]
- else
- pSprite.cursor = 271
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- put (the mouseH - sprite(1).left) * 2 / gVariable / 2 into field "location status X"
- put (the mouseV - sprite(1).top) * 2 / gVariable / 2 into field "location status Y"
- end
-
- on mouseEnter me
- if sprite(64).pState = 1 then
- pSprite.cursor = 256
- member(391).shapeType = gPencilShape
- else
- if sprite(73).pState = 1 then
- pSprite.cursor = [350, 351]
- member(391).shapeType = gBrushShape
- else
- if sprite(84).pState = 1 then
- pSprite.cursor = [352, 353]
- member(391).shapeType = gEraserShape
- else
- if sprite(96).pState = 1 then
- pSprite.cursor = [354, 355]
- member(391).shapeType = gAirbrushShape
- else
- if sprite(104).pState = 1 then
- pSprite.cursor = [348, 349]
- member(391).shapeType = gClonerShape
- else
- if sprite(116).pState = 1 then
- pSprite.cursor = 271
- gShapeType = #rect
- else
- if sprite(121).pState = 1 then
- pSprite.cursor = 271
- gShapeType = #oval
- else
- if sprite(126).pState = 1 then
- pSprite.cursor = 271
- gShapeType = #roundRect
- else
- if sprite(131).pState = 1 then
- pSprite.cursor = 271
- else
- if sprite(138).pState = 1 then
- pSprite.cursor = 271
- else
- if sprite(142).pState = 1 then
- pSprite.cursor = 259
- else
- if sprite(143).pState = 1 then
- pSprite.cursor = [344, 345]
- else
- if sprite(144).pState = 1 then
- pSprite.cursor = [346, 347]
- else
- if sprite(146).pState = 1 then
- pSprite.cursor = 271
- else
- if sprite(147).pState = 1 then
- pSprite.cursor = 1
- else
- if sprite(240).pState = 1 then
- pSprite.cursor = [432, 433]
- else
- if sprite(272).pState = 1 then
- pSprite.cursor = [466, 467]
- sendSprite(3, #hotspotOn)
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- currentCursor = pSprite.cursor
- end
-
- on mouseLeave me
- pSprite.cursor = 0
- put EMPTY into field "location status X"
- put EMPTY into field "location status Y"
- if (sprite(64).pState = 1) or (sprite(73).pState = 1) or (sprite(84).pState = 1) or (sprite(96).pState = 1) or (sprite(104).pState = 1) then
- sprite(8).rect = rect(-60, -60, 0, 0)
- end if
- if gProject = "cursor" then
- if sprite(272).pState = 1 then
- sendSprite(3, #hotspotOff)
- end if
- end if
- end
-
- on mouseDown
- if pUndoTrigger = 0 then
- if sprite(146).pState <> 1 then
- pUndoTrigger = 1
- end if
- end if
- if sprite(64).pState = 1 then
- if gPencilSize = 1 then
- tool1PxPencil()
- else
- toolPencil()
- end if
- else
- if sprite(73).pState = 1 then
- toolBrush()
- else
- if sprite(84).pState = 1 then
- if gEraserSize = 1 then
- tool1PxEraser()
- else
- toolEraser()
- end if
- else
- if sprite(96).pState = 1 then
- toolAirbrush()
- else
- if sprite(104).pState = 1 then
- if gClonerSize = 1 then
- tool1PxCloner()
- else
- toolCloner()
- end if
- else
- if sprite(116).pState = 1 then
- if gRectStyle = "outline" then
- toolOutlineShape()
- else
- if gRectStyle = "filled" then
- toolFilledShape()
- else
- if gRectStyle = "solid" then
- toolSolidShape()
- end if
- end if
- end if
- else
- if sprite(121).pState = 1 then
- if gOvalStyle = "outline" then
- toolOutlineShape()
- else
- if gOvalStyle = "filled" then
- toolFilledShape()
- else
- if gOvalStyle = "solid" then
- toolSolidShape()
- end if
- end if
- end if
- else
- if sprite(126).pState = 1 then
- if gRoundRectStyle = "outline" then
- toolOutlineShape()
- else
- if gRoundRectStyle = "filled" then
- toolFilledShape()
- else
- if gRoundRectStyle = "solid" then
- toolSolidShape()
- end if
- end if
- end if
- else
- if sprite(131).pState = 1 then
- toolStraightLine()
- else
- if sprite(138).pState = 1 then
- if gGradientDirection = "H" then
- toolGradientH4()
- else
- if gGradientDirection = "V" then
- toolGradientV4()
- else
- if gGradientDirection = "rect" then
- toolGradientRect4()
- else
- if gGradientDirection = "oval" then
- toolGradientOval4()
- end if
- end if
- end if
- end if
- else
- if sprite(142).pState = 1 then
- toolFill()
- else
- if sprite(143).pState = 1 then
- toolCheckerFill()
- else
- if sprite(144).pState = 1 then
- toolChangeColor()
- else
- if sprite(146).pState = 1 then
- if (gMarqueeRect <> rect(0, 0, 0, 0)) and inside(point(the mouseH, the mouseV), gMarqueeRect) then
- moveSelect()
- else
- toolSelect()
- end if
- else
- if sprite(147).pState = 1 then
- toolText()
- else
- if sprite(240).pState = 1 then
- toolWarp()
- else
- if sprite(272).pState = 1 then
- toolHotspot()
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end
-
- on rightMouseDown
- if sprite(146).pState = 1 then
- nothing()
- else
- if sprite(104).pState = 1 then
- pSprite.cursor = [359, 360]
- gClonerFlag = 0
- sprite(9).blend = 100
- sprite(9).loc = point(((the mouseH - sprite(1).left) * 2 / gVariable / 2 * gVariable) + sprite(1).left + (gVariable / 2), ((the mouseV - sprite(1).top) * 2 / gVariable / 2 * gVariable) + sprite(1).top + (gVariable / 2))
- else
- pSprite.cursor = [361, 362]
- gCurrentColor = member(gSize & "x" & gSize, gCast).image.getPixel((the mouseH - sprite(1).left) * 2 / gVariable / 2, (the mouseV - sprite(1).top) * 2 / gVariable / 2)
- put gCurrentColor.red into field "red status"
- put gCurrentColor.green into field "green status"
- put gCurrentColor.blue into field "blue status"
- put gCurrentColor.hexString() into field "hex status"
- put getProp(g4bitValues, gCurrentColor.paletteIndex) into field "paletteIndex status"
- if sprite(47).rect = rect(598, 13, 622, 37) then
- gFirstColor = gCurrentColor
- member("1st Color", gCast).image.fill(member("1st Color", gCast).rect, gFirstColor)
- else
- if sprite(47).rect = rect(598, 43, 622, 67) then
- gSecondColor = gCurrentColor
- member("2nd Color", gCast).image.fill(member("2nd Color", gCast).rect, gSecondColor)
- else
- if sprite(47).rect = rect(48, 518, 67, 537) then
- gWvBgColor = gCurrentColor
- member("weave - bg color", gCast).image.fill(member("weave - bg color", gCast).rect, gWvBgColor)
- else
- if sprite(47).rect = rect(68, 518, 87, 537) then
- gWvBgShadow = gCurrentColor
- member("weave - bg shadow", gCast).image.fill(member("weave - bg shadow", gCast).rect, gWvBgShadow)
- else
- if sprite(47).rect = rect(48, 543, 67, 562) then
- gWvVcolor = gCurrentColor
- member("weave - V color", gCast).image.fill(member("weave - V color", gCast).rect, gWvVcolor)
- else
- if sprite(47).rect = rect(68, 543, 87, 562) then
- gWvVShadow = gCurrentColor
- member("weave - V shadow", gCast).image.fill(member("weave - V shadow", gCast).rect, gWvVShadow)
- else
- if sprite(47).rect = rect(48, 568, 67, 587) then
- gWvHcolor = gCurrentColor
- member("weave - H color", gCast).image.fill(member("weave - H color", gCast).rect, gWvHcolor)
- else
- if sprite(47).rect = rect(68, 568, 87, 587) then
- gWvHShadow = gCurrentColor
- member("weave - H shadow", gCast).image.fill(member("weave - H shadow", gCast).rect, gWvHShadow)
- else
- if sprite(47).rect = rect(593, 263, 617, 287) then
- member("4bit transparency color", gCast).image.fill(member("4bit transparency color", gCast).rect, gCurrentColor)
- sprite(1).bgColor = gCurrentColor
- sprite(20).bgColor = gCurrentColor
- sprite(261).bgColor = gCurrentColor
- sprite(262).bgColor = gCurrentColor
- sprite(263).bgColor = gCurrentColor
- sprite(264).bgColor = gCurrentColor
- sprite(47).rect = rect(598, 13, 622, 37)
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- gCurrentColor = VOID
- end if
- end if
- end
-
- on rightMouseUp
- if sprite(146).pState = 1 then
- nothing()
- else
- pSprite.cursor = currentCursor
- put EMPTY into field "red status"
- put EMPTY into field "green status"
- put EMPTY into field "blue status"
- put EMPTY into field "hex status"
- put EMPTY into field "paletteIndex status"
- end if
- end
-
- on mouseUpOutSide
- if the rightMouseUp then
- if sprite(146).pState = 1 then
- nothing()
- else
- pSprite.cursor = currentCursor
- put EMPTY into field "red status"
- put EMPTY into field "green status"
- put EMPTY into field "blue status"
- put EMPTY into field "hex status"
- put EMPTY into field "paletteIndex status"
- end if
- end if
- end
-
- on mFlood me, aX, aY, aSourceColor
- targetColor = myCurrentImage.getPixel(aX, aY)
- myCurrentImage.setPixel(aX, aY, aSourceColor)
- append(pPixelActorListX, aX)
- append(pPixelActorListY, aY)
- repeat while count(pPixelActorListX)
- xCur = getAt(pPixelActorListX, 1)
- yCur = getAt(pPixelActorListY, 1)
- deleteAt(pPixelActorListX, 1)
- deleteAt(pPixelActorListY, 1)
- repeat with n = 1 to 4
- xTest = xCur + getAt(pSpreadListX, n)
- yTest = yCur + getAt(pSpreadListY, n)
- if myCurrentImage.getPixel(xTest, yTest) = targetColor then
- myCurrentImage.setPixel(xTest, yTest, aSourceColor)
- append(pPixelActorListX, xTest)
- append(pPixelActorListY, yTest)
- end if
- end repeat
- end repeat
- end
-
- on mFlood2 me, aX, aY, aSourceColor
- targetColor = myCurrentImage.getPixel(aX, aY)
- myCurrentImage.setPixel(aX, aY, aSourceColor)
- append(pPixelActorListX, aX)
- append(pPixelActorListY, aY)
- repeat while count(pPixelActorListX)
- xCur = getAt(pPixelActorListX, 1)
- yCur = getAt(pPixelActorListY, 1)
- deleteAt(pPixelActorListX, 1)
- deleteAt(pPixelActorListY, 1)
- repeat with n = 1 to 4
- xTest = xCur + getAt(pSpreadListX, n)
- yTest = yCur + getAt(pSpreadListY, n)
- if myCurrentImage.getPixel(xTest, yTest) = targetColor then
- if (((aX mod 2) = 1) and ((aY mod 2) = 0)) or (((aX mod 2) = 0) and ((aY mod 2) = 1)) then
- if (((xTest mod 2) = 1) and ((yTest mod 2) = 0)) or (((xTest mod 2) = 0) and ((yTest mod 2) = 1)) then
- myCurrentImage.setPixel(xTest, yTest, aSourceColor)
- append(pPixelActorListX, xTest)
- append(pPixelActorListY, yTest)
- else
- myCurrentImage.setPixel(xTest, yTest, targetColor)
- append(pPixelActorListX, xTest)
- append(pPixelActorListY, yTest)
- end if
- next repeat
- end if
- if (((xTest mod 2) = 1) and ((yTest mod 2) = 0)) or (((xTest mod 2) = 0) and ((yTest mod 2) = 1)) then
- myCurrentImage.setPixel(xTest, yTest, targetColor)
- append(pPixelActorListX, xTest)
- append(pPixelActorListY, yTest)
- next repeat
- end if
- myCurrentImage.setPixel(xTest, yTest, aSourceColor)
- append(pPixelActorListX, xTest)
- append(pPixelActorListY, yTest)
- end if
- end repeat
- end repeat
- end
-